﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_LayoutStatistics.cshtml";
}
<script type="text/javascript">
    var grid_selector = "#grid-table";
    var pager_selector = "#grid-pager";
    $(function () {
        $(grid_selector).jqGrid({
            url: "/SComment/GetGridData",
            datatype: "json",
            postData: {
                startTime: $('#dpStart').val(),
                endTime: $('#dpEnd').val()
            },
            autowidth: true,
            pager: pager_selector,
            loadonce: true,
            rowNum: 10,
            rowList: [10, 30, 50],
            height: $(document).height() - 127,
            colModel: [{
                label: '单位编码',
                name: 'unitSeq',
                width: 70
            },
        {
            label: '单位名称',
            name: 'unitName',
            width: 100
        },
        {
            label: '服务态度好评率',
            name: 'AttitudePercent',
            width: 70
        },
        {
            label: '完成质量好评率',
            name: 'QualityPercent',
            width: 70
        },
        {
            label: '处理效率好评率',
            name: 'EfficiencyPercent',
            width: 70
        },
        {
            label: '廉洁自律好评率',
            name: 'HonestPercent',
            width: 70
        }],
            loadComplete: function () {
                var table = this;
                setTimeout(function () {
                    updatePagerIcons(table);
                },
            0);
                $(grid_selector).selectFirstRow();
            }
        });
    });

    function Refresh() {
        $(grid_selector).setGridParam({
            datatype: "json",
            postData: {
                startTime: $('#dpStart').val(),
                endTime: $('#dpEnd').val()
            },
            page: 1
        }).trigger('reloadGrid');
    }
</script>
<div class="btn-group">
    <label class="col-sm-1">
        开始时间</label>
    <div class="input-group col-sm-2">
        <input class="form-control date-picker" id="dpStart" value="@ViewBag.dtStart" type="text" />
        <span class="input-group-addon"><i class="icon-calendar bigger-110"></i></span>
    </div>
    <label class="col-sm-1">
        结束时间</label>
    <div class="input-group col-sm-2">
        <input class="form-control date-picker" id="dpEnd" value="@ViewBag.dtEnd" type="text" />
        <span class="input-group-addon"><i class="icon-calendar bigger-110"></i></span>
    </div>
    <div class="col-sm-3">
        <button class="btn btn-sm btn-yellow" onclick="Refresh()">
            <i class="icon-search bigger-110"></i>查询</button>
    </div>
</div>
<table id="grid-table">
</table>
<div id="grid-pager">
</div>
